package guoan.core.configuration;

import java.util.Map;

import com.google.common.collect.Maps;

public class WeiXinCfgBean {

	public static final String LINK_EXAM = "EXAM";
	public static final String LINK_EXAM_VALUE = "/weixin/exam/index";

	public static final String LINK_COACH_TRAIN = "COACHTRAIN";
	public static final String LINK_COACH_TRAIN_VALUE = "/weixin/coach/index_2";

	public static final String LINK_COACH_STUDENT = "COACHSTUDENT";
	public static final String LINK_COACH_STUDENT_VALUE = "/weixin/coach/index_1";

	private String appid;
	private String appscret;
	private String host;
	private Map<String, String> linkMap;

	public WeiXinCfgBean() {

	}

	public WeiXinCfgBean(String appid, String appscret, Map<String, String> linkMap) {
		super();
		this.appid = appid;
		this.appscret = appscret;
		this.linkMap = linkMap;
	}

	public static WeiXinCfgBean withDefault() {
		WeiXinCfgBean bean = new WeiXinCfgBean();
		Map<String, String> defMap = Maps.newHashMap();
		defMap.put(LINK_EXAM, LINK_EXAM_VALUE);
		defMap.put(LINK_COACH_TRAIN, LINK_COACH_TRAIN_VALUE);
		defMap.put(LINK_COACH_STUDENT, LINK_COACH_STUDENT_VALUE);

		bean.setLinkMap(defMap);
		return bean;
	}

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getAppscret() {
		return appscret;
	}

	public void setAppscret(String appscret) {
		this.appscret = appscret;
	}

	public Map<String, String> getLinkMap() {
		return linkMap;
	}

	public void setLinkMap(Map<String, String> linkMap) {
		this.linkMap = linkMap;
	}

	public String findLinkValue(String key) {
		return getLinkMap().get(key);
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

}
